from django.contrib import admin
from .models import Task, TaskAssignment, TaskCompletion


@admin.register(Task)
class TaskAdmin(admin.ModelAdmin):
    list_display = ('id', 'title', 'points', 'target', 'daily', 'active', 'created_at')
    list_filter = ('daily', 'active')
    search_fields = ('title',)


@admin.register(TaskAssignment)
class TaskAssignmentAdmin(admin.ModelAdmin):
    list_display = ('id', 'date', 'task', 'created_at')
    list_filter = ('date',)


@admin.register(TaskCompletion)
class TaskCompletionAdmin(admin.ModelAdmin):
    list_display = ('id', 'user', 'task', 'date', 'created_at')
    list_filter = ('date', 'task')
    search_fields = ('user__username',)

